home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / p_exit.c < prev    next >
Text File  |  1993-08-08  |  575b  |  23 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <process.h>
  6. include <debug.h>    /* DELETE */
  7. / stop this process with this exitcode
  8. oid process::exit(long exitcode)
  9.  
  10.    if (debug) /*DELETE*/ cerr << "process" << this << "::exit(" << exitcode << ")\n";
  11.    if (mustrecurse())
  12. exit(exitcode);
  13.  
  14.    else
  15. {
  16. kill(exitcode);
  17. if (this == t_thisprocess)
  18.     if (!contextswitch())
  19.     schedule();
  20. if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::exit(" << exitcode << ")\n";
  21. }
  22.  
  23.